package com.berg.metroarrived;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import com.berg.metroarrived.MonitorService;

public class UserUnlockScreenReceiver extends BroadcastReceiver {
	private static final String DTAG = "metroarrived_receiver";

	@Override
	public void onReceive(Context context, Intent intent) {
	    
		//enable service?
		SharedPreferences mPref = context.getSharedPreferences(context.getPackageName(), context.MODE_PRIVATE);
		boolean service_enabled = mPref.getBoolean("service_enabled", false);
		Log.d(DTAG,"service_enabled "+ String.valueOf(service_enabled));
		if(service_enabled){
			context.startService(new Intent(context,MonitorService.class));	
		}
	}

}
